import java.util.ArrayList;

public class HashTable<E> {
    public ArrayList[] lists;
    public HashTable(int size){
        this.lists=new ArrayList[size];
        for (int i=0;i<lists.length;i++){
            lists[i] = new ArrayList();
        }
    }
    public int Hash(int k){
        return k % lists.length;
    }
    public void insert(int[] a)throws Exception{
        for (int i=0;i<a.length;i++){
            int k = Hash(a[i]);
            lists[k].add(a[i]);
        }
    }
    public void print(){
        for (int i=0;i<lists.length;i++){
            System.out.print("lists["+i+"]="+lists[i]);
            System.out.println();
        }
    }
}
